package cn.bdqn.dao;

import cn.bdqn.pojo.User;
import org.apache.ibatis.session.SqlSession;

import java.util.List;

public class UserMapperImpl implements UserMapper {

    private SqlSession sqlSession;

    public void setSqlSession(SqlSession sqlSession) {
        this.sqlSession = sqlSession;
    }

    public List<User> getUserList() {
        addUser(new User(5,"LXX","000000"));
        deleteUserById(4);
        return sqlSession.getMapper(UserMapper.class).getUserList();
    }

    public void addUser(User user) {
        sqlSession.getMapper(UserMapper.class).addUser(user);
    }

    public void deleteUserById(int id) {
        sqlSession.getMapper(UserMapper.class).deleteUserById(id);
    }
}
